package com.sport.setting.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sport.model.program.pojos.SportProgramMemberItem;
import com.sport.model.program.vos.ItemListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface SportProgramMemberItemMapper extends BaseMapper<SportProgramMemberItem> {

    @Select("SELECT sport_member_id,GROUP_CONCAT(sport_events_id) AS sport_events_ids FROM sport_program_member_item "
            +" WHERE school_tenement_id = #{schoolTenementId} "
            +" GROUP BY sport_member_id")
    List<Map<String,Object>> getSportMemberAllocatedItem(@Param("schoolTenementId")String schoolTenementId);

    @Select("SELECT sport_start_date,sport_events_type "
            +"FROM sport_program_member_item "
            +"GROUP BY sport_start_date,sport_events_type ")
    List<Map<String,String>> getSportEventsTimeType(@Param("schoolTenementId")String schoolTenementId);

}
